import { Tools } from 'weaver-mobile';
import { catchApiError } from '../util/index';
import { PARAMS } from '../components/public/BlogUtils';

// 他的微博 - 个人信息
export const getBlogPersonalInfo = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getBlogPersonalInfo',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 他的微博 - 列表
export const getViewBlogList = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getViewBlogList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 他的微博 - 他的关注
export const getMyBlogAttention = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getMyBlogAttention',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 他的微博 - 他的粉丝
export const getAttentionMesUsers = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getAttentionMesUsers',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

export const addSpecialUsers = (params) => {
    let options = {
        method: 'POST',
        url:'/api/blog/myblog/addSpecialUser',
        params: {...PARAMS, ...params}
    }
    return Tools.callApi(options).then(catchApiError);
}

export const cancelSpecialUsers = (params) => {
    let options = {
        method: 'POST',
        url:'/api/blog/myblog/cancelSpecialUser',
        params: {...PARAMS, ...params}
    }
    return Tools.callApi(options).then(catchApiError);
}

